import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/LoginVue',
      name: 'LoginVue',
      component: () => import('@/views/Login/LoginVue.vue')
    },
    {
      path: '/',
      redirect: '/Home'
    },
    {
      path: '/Home',
      name: 'Home',
      component: () => import('@/views/Home/HomeView.vue'),
      redirect: '/home/welcome',
      children: [
        // 静态路由
        {
          path: '/home/welcome',
          name: 'welcome',
          component: () => import('@/views/Home/Children/welcomeView.vue')
        }

        // {
        //   path: '/home/users',
        //   name: 'users',
        //   component: () => import('@/views/Home/Children/UserView.vue')
        // },
        // {
        //   path: '/home/roles',
        //   name: 'AuthorityA ',
        //   component: () => import('@/views/Home/Children/AuthorityA.vue')
        // },
        // {
        //   path: '/home/rights',
        //   name: 'JurisdictionA',
        //   component: () => import('@/views/Home/Children/JurisdictionA.vue')
        // },
        // {
        //   path: '/home/goods',
        //   name: 'GoodsView',
        //   component: () => import('../views/Home/Children/GoodsView.vue')
        // },
        // {
        //   path: '/home/categories',
        //   name: 'GoodsAdd',
        //   component: () => import('../views/Home/Children/GoodsAdd.vue')
        // },
        // {
        //   path: '/home/params',
        //   name: 'ClassifyA',
        //   component: () => import('@/views/Home/Children/ClassifyA.vue')
        // },
        // {
        //   path: '/home/orders',
        //   name: 'OrderForm',
        //   component: () => import('@/views/Home/Children/OrderForm.vue')
        // }
      ]
    },
    // 404页面写在动态添加路由的最后
    // {
    //   path: '/:pathMatch(.*)*',
    //   name: 'NotFound',
    //   component: () => import('@/views/Home/NotFound.vue')
    // }
  ]
})

export default router
